package com.five.taotao.product_details;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.five.taotao.R;
import com.five.taotao.entity.Store;
import com.five.taotao.selfwidget.MyListView;
import com.five.taotao.social.SocialAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * A simple {@link Fragment} subclass.
 * 详情界面
 */
public class DetailsFragment extends Fragment {


    public DetailsFragment() {
        // Required empty public constructor
    }

    @BindView(R.id.lv)
    MyListView lv;
    private View v;



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        if (v==null){
            v=inflater.inflate(R.layout.fragment_details2, container, false);
            ButterKnife.bind(this, v);
            //listview
            List<Store> data=initData2();
            SocialAdapter lvadapter=new SocialAdapter(data,getActivity());
            lv.setAdapter(lvadapter);

        }
        return v;

    }
    //listview
    /**
     * 初始化数据
     * @return
     */
    public List<Store> initData2() {
        List<Store> list = new ArrayList<>();

        Store store = new Store();
        store.setImg1(R.drawable.psb);
        store.setImg2(R.drawable.img17);
        store.setTv1("水密码专卖店");
        store.setTv2("编辑精选");
        store.setTv3("Hello,宝宝们，欢迎进入这家好店。");
        list.add(store);



        return list;
    }


}
